package com.hantang.web.servlet;

import java.io.PrintWriter;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;

import com.hantang.web.json.handlers.LoginHandler;

public class LoginServlet extends BaseServlet {

	private static Logger logger = Logger.getLogger(LoginServlet.class);
	/**
	 * 
	 */
	private static final long serialVersionUID = 3236038455508553669L;

	@Override
	public int doService(HttpServletRequest request, PrintWriter out) {
		// TODO Auto-generated method stub
		
		String username = request.getParameter(PARAM_USER_NAME);
		String password = request.getParameter(PARAM_PASSWORD);
		logger.info("doService, username:" + username + "password:" + password) ;
		String res = LoginHandler.login(username, password);
		out.print(res);
		return SERVLET_SUCCESS_CODE;
	}

}
